package com.dalei.vdsmanager.management.vds.action;

import java.util.List;

import com.dalei.vdsmanager.management.vds.dao.VDSDeviceStatus;
import com.dalei.vdsmanager.management.vds.service.VDSDeviceStatusService;
import com.opensymphony.xwork2.ActionSupport;

public class ListVDSDeviceStatusAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3769684634933120494L;
	
	private VDSDeviceStatusService vdsDeviceStatusService;
	
	private List<VDSDeviceStatus> vdsDeviceStatus;

	public VDSDeviceStatusService getVdsDeviceStatusService() {
		return vdsDeviceStatusService;
	}

	public void setVdsDeviceStatusService(
			VDSDeviceStatusService vdsDeviceStatusService) {
		this.vdsDeviceStatusService = vdsDeviceStatusService;
	}

	public List<VDSDeviceStatus> getVdsDeviceStatus() {
		return vdsDeviceStatus;
	}

	public void setVdsDeviceStatus(List<VDSDeviceStatus> vdsDeviceStatus) {
		this.vdsDeviceStatus = vdsDeviceStatus;
	}
	
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		// return super.execute();
		vdsDeviceStatus = vdsDeviceStatusService.getDeviceStatus();
		if (vdsDeviceStatus != null) {
			return SUCCESS;
		} else {
			return ERROR;
		}
	}
}
